﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using BlueCMS.Core.Data.Query.Columns;

namespace BlueCMS.Core.Data.Query.Clauses
{
    public class SelectClause : ISelectClause
    {
        public List<SelectColumn> SelectColumns { get; private set; }

        public SelectClause()
        {
            SelectColumns = new List<SelectColumn>();
        }

        void ISelectClause.All()
        {
            SelectColumns.Clear();
        }

        ISelectColumn ISelectClause.Column(string name)
        {
            SelectColumn column = new SelectColumn(name, SelectType.Column, this);
            SelectColumns.Add(column);
            return column;
        }

        ISelectColumn ISelectClause.Aggregate(string clause)
        {
            SelectColumn column = new SelectColumn(clause, SelectType.Aggregate, this);
            SelectColumns.Add(column);
            return column;
        }
    }
}
